<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Packagist Search</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css">
</head>
<body>
<div class="pure-g" style="width:1180px;margin:10px auto;">
    <div class="pure-u">
        <form class="pure-form" method="POST">
            <input type="text" name="s" value="<?php echo (isset($keyword))?$keyword:'';?>" />
            <button type="submit" class="pure-button pure-button-primary" style="font-size:85%;">Search</button>
        </form>

        <?php if (isset($data)):?>
            <?php if (empty($data)):?>
                <p>No packages found.</p>
            <?php else:?>
                <table class="pure-table pure-table-bordered" style="margin-top:10px;">
                <?php $i = 0;?>
                <?php foreach ($data as $item):?>
                <?php $i++;?>
                    <tr <?php echo ($i%2==1)?'class="pure-table-odd"':'';?>>
                        <td><a href="<?php echo $item['url'];?>" target="_blank"><?php echo $item['name'];?></a></td>
                        <td><?php echo $item['description'];?></td>
                        <td><?php echo $item['downloads'];?></td>
                    </tr>
                <?php endforeach;?>
                </table>
            <?php endif;?>
        <?php endif;?>
    </div>
</div>
</body>
</html>